package com.handinglian.common.factory;

import com.handinglian.common.dto.ResultData;

public class ResultDataFactory {

    public static ResultData generateResultData(Integer amount){
        if (amount > 0){
            return ResultData.success(amount);
        } else {
            return ResultData.failed();
        }
    }

    public static <T> ResultData generateSuccessResultData(T data){
        return ResultData.success(data);
    }

    public static <T> ResultData generateExistInDeleteResultData(){
        return ResultData.existsInDelete();
    }
}
